package com.sunwayworld.basemodule.common.asynctask.service;

import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.basemodule.common.asynctask.bean.LimsAsynctaskBean;
import com.sunwayworld.basemodule.common.asynctask.bean.LimsAsynctaskInsert;
import com.sunwayworld.basemodule.common.asynctask.bean.LimsAsynctaskScheduleBean;
import com.sunwayworld.basemodule.common.asynctask.bean.LimsAsynctaskServerBean;
import com.sunwayworld.basemodule.common.asynctask.statics.TaskStaticsInfo;
import com.sunwayworld.basemodule.common.asynctask.statics.TaskTypeExecuteInfo;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.support.base.service.GenericService;
import com.sunwayworld.framework.support.choosable.service.GenericChoosableService;
import com.sunwayworld.module.mdm.user.bean.CoreUserBean;

import java.util.List;
import java.util.Map;

public interface LimsAsynctaskService extends GenericService<LimsAsynctaskBean, Long>, GenericChoosableService<LimsAsynctaskBean, Long> {

    //插入任务
    Map<String,Object> addAsyncTask(List<LimsAsynctaskInsert> inserts, CoreUserBean loginUser);

    //restful
    boolean restTemplateGetCheckLive(String interfaceUrl);

    //设定的一个系统定时任务，为插入的任务，更新个排队字段
    void scheduleUpdateWaitExecTask();

    //测试执行，在本节点的executor上执行
    Map<String,Object> testTask(List<LimsAsynctaskBean> limsAsynctaskBeans);

    void testWithJsonParam(JSONObject jsonObject);
    String testWithOutJsonParam();

    TaskStaticsInfo queryTaskStaticsInfo();

    TaskTypeExecuteInfo queryTaskTypeExecuteInfo();

    void initialTaskOnDeadLives();

    List<LimsAsynctaskServerBean> asyncServerHealth();

    List<LimsAsynctaskScheduleBean> asyncServerScheduleStatus(RestJsonWrapperBean wrapperBean);
}
